#include "headers/RGB.h"
#include <SDL/SDL_ttf.h>

int GetRGBFromNesColor(unsigned char color) {
    
    switch(color) {
        case 0x0:
            return GetRGB(0x80,0x80,0x80);
        case 0x1:
            return GetRGB(0x00,0x3D,0xA6);
        case 0x2:
            return GetRGB(0x00,0x12,0xB0);
        case 0x3:
            return GetRGB(0x44,0x00,0x96);
        case 0x4:
            return GetRGB(0xA1,0x00,0x5E);
        case 0x5:
            return GetRGB(0xC7,0x00,0x28);
        case 0x6:
            return GetRGB(0xBA,0x06,0x00);
        case 0x7:
            return GetRGB(0x8C,0x17,0x00);
        case 0x8:
            return GetRGB(0x5C,0x2F,0x00);
        case 0x9:
            return GetRGB(0x10,0x45,0x00);
        case 0xA:
            return GetRGB(0x05,0x4A,0x00);
        case 0xB:
            return GetRGB(0x00,0x47,0x2E);
        case 0xC:
            return GetRGB(0x00,0x41,0x66);
        case 0xD:
            return GetRGB(0x00,0x00,0x00);
        case 0xE:
            return GetRGB(0x05,0x05,0x05);
        case 0xF:    
            return GetRGB(0x05,0x05,0x05);
        case 0x10:
            return GetRGB(0xC7,0xC7,0xC7);
        case 0x11:
            return GetRGB(0x00,0x77,0xFF);
        case 0x12:
            return GetRGB(0x21,0x55,0xFF);
        case 0x13:
            return GetRGB(0x82,0x37,0xFA);
        case 0x14:
            return GetRGB(0xEB,0x2F,0xB5);
        case 0x15:
            return GetRGB(0xFF,0x29,0x50);
        case 0x16:
            return GetRGB(0xFF,0x22,0x00);
        case 0x17:
            return GetRGB(0xD6,0x32,0x00);
        case 0x18:
            return GetRGB(0xC4,0x62,0x00);
        case 0x19:
            return GetRGB(0x35,0x80,0x00);
        case 0x1A:
            return GetRGB(0x05,0x8F,0x00);
        case 0x1B:
            return GetRGB(0x00,0x8A,0x55);
        case 0x1C:
            return GetRGB(0x00,0x99,0xCC);
        case 0x1D:
            return GetRGB(0x21,0x21,0x21);
        case 0x1E:
            return GetRGB(0x09,0x09,0x09);
        case 0x1F:
            return GetRGB(0x09,0x09,0x09);
        case 0x20:
            return GetRGB(0xFF,0xFF,0xFF);
        case 0x21:
            return GetRGB(0x0F,0xD7,0xFF);
        case 0x22:
            return GetRGB(0x69,0xA2,0xFF);
        case 0x23:
            return GetRGB(0xD4,0x80,0xFF);
        case 0x24:
            return GetRGB(0xFF,0x45,0xF3);
        case 0x25:
            return GetRGB(0xFF,0x61,0x8B);
        case 0x26:
            return GetRGB(0xFF,0x88,0x33);
        case 0x27:
            return GetRGB(0xFF,0x9C,0x12);
        case 0x28:
            return GetRGB(0xFA,0xBC,0x20);
        case 0x29:
            return GetRGB(0x9F,0xE3,0x0E);
        case 0x2A:
            return GetRGB(0x2B,0xF0,0x35);
        case 0x2B:
            return GetRGB(0x0C,0xF0,0xA4);
        case 0x2C:
            return GetRGB(0x05,0xFB,0xFF);
        case 0x2D:
            return GetRGB(0x5E,0x5E,0x5E);
        case 0x2E:
            return GetRGB(0x0D,0x0D,0x0D);
        case 0x2F:
            return GetRGB(0x0D,0x0D,0x0D);
        case 0x30:
            return GetRGB(0xFF,0xFF,0xFF);
        case 0x31:
            return GetRGB(0xA6,0xFC,0xFF);
        case 0x32:
            return GetRGB(0xB3,0xEC,0xFF);
        case 0x33:
            return GetRGB(0xDA,0xAB,0xEB);
        case 0x34:
            return GetRGB(0xFF,0xA8,0xF9);
        case 0x35:
            return GetRGB(0xFF,0xAB,0xB3);
        case 0x36:
            return GetRGB(0xFF,0xD2,0xB0);
        case 0x37:
            return GetRGB(0xFF,0xEF,0xA6);
        case 0x38:
            return GetRGB(0xFF,0xF7,0x9C);
        case 0x39:
            return GetRGB(0xD7,0xE8,0x95);
        case 0x3A:
            return GetRGB(0xA6,0xED,0xAF);
        case 0x3B:
            return GetRGB(0xA2,0xF2,0xDA);
        case 0x3C:
            return GetRGB(0x99,0xFF,0xFC);
        case 0x3D:
            return GetRGB(0xDD,0xDD,0xDD);
        case 0x3E:
            return GetRGB(0x11,0x11,0x11);
        case 0x3F:
            return GetRGB(0x11,0x11,0x11);
    }
}
    
